package banking;
import banking.*;
public class TestBanking {

	public static void main(String[] args) {
		// TODO 自动生成的方法存根
		Customer customer;//定义数据类型为Customer的customer成员
	    Account  account;//定义数据类型为Account的account成员
	    // Create an account that can has a 500.00 balance.
	    System.out.println("Creating the customer Jane Smith.");
	    customer = new Customer("Jane", "Smith");//实例化，给customer成员分配一定的内存并传入参数
	    System.out.println("Creating her account with a 500.00 balance.");
	    customer.setAccount(new Account(500.00));//实例化，调用Customer的set方法，并向Account方法中传入参数
	    account = customer.getAccount();//实例化，读取账户余额信息，并返回给account成员
	    // Perform some account transactions
	    System.out.println("Withdraw 150.00: " + account.withdraw(150.00));//调用Acconut类中的withdraw方法
	    System.out.println("Deposit 22.50: " + account.deposit(22.50));//调用Acconut类中的deposit方法
	    System.out.println("Withdraw 47.62: " + account.withdraw(47.62));//调用Acconut类中的withdraw方法
	    System.out.println("Withdraw 400.00: " + account.withdraw(400.00));//调用Acconut类中的withdraw方法
	    // Print out the final account balance
	    System.out.println("Customer [" + customer.getLastName()//调用Customer的getLastname方法和getFirstname方法
			       + ", " + customer.getFirstName()
			       + "] has a balance of " + account.getBalance());//调用Acount的getBalance方法，输出余额

	}

}
